home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1551 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.3 KB  |  52 lines

  1. Path: news.rain.org!usenet
  2. From: "Guus Leeuw jr." <guusl@eiffel.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Dumb Question? about ptr
  5. Date: Thu, 11 Jan 1996 08:38:31 -0800
  6. Organization: ISE Inc. http://www.eiffel.com
  7. Message-ID: <30F53D07.33DC5035@eiffel.com>
  8. References: <00001a81+00008b8f@msn.com>
  9. NNTP-Posting-Host: @outback.eiffel.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b3 (X11; I; Linux 1.2.8 i586)
  14.  
  15. The ugly pink sweater book The Orange book is wrote:
  16. > Dont laugh im only been programming in this for a few hours but why is
  17. > this giving me the following errors in Line 11 (I copied straight out
  18. > o a how to program in C++ book. Yes the compilers match i have
  19. > Borland C++ 4.02
  20. > Error NONAME00.CPP 11: Type name expected
  21. > Error NONAME00.CPP 11: Variable 'foo' is initialized more than once
  22. > Error NONAME00.CPP 11: Improper use of typedef 'MyStruct'
  23. > #include <iostream.h>
  24. > class MyStruct {
  25. >         public:
  26. >         int data;
  27. >         int value;
  28. > };
  29. > MyStruct *foo;
  30. > MyStruct Record1;
  31. > foo = &MyStruct;
  32.  
  33.          ^^^^^^^^ Guess that this should be Record1, instead.
  34.  
  35. > void main() {
  36.  
  37. And this should read: `int main()' (According to ANSI C++ at least)
  38.  
  39. >         foo->data=5;
  40. >         cout << foo->data;
  41. > };
  42.  
  43. Regards,
  44.     Guus Leeuw jr.
  45.